package com.sywb.chuangyebao.bean;

import java.io.Serializable;

/**
 * 文章评论点赞数量信息
 */
public class NewsCount implements Serializable {

    public int hits;// 访问量
    public int comment;// 评论数
    public int thumb_up;// 点赞数
    public int thumb_down;// 反对数
    public int wd_answer;//回答数
    public int favorite;//收藏数
    public int play_times_total;// 播放次数

    public String getHitsString() {
        String hitsString;
        if (hits >= 10000) {
            java.text.DecimalFormat df = new java.text.DecimalFormat("#.0");
            hitsString = df.format(hits / 10000d) + "万";
        } else {
            hitsString = String.valueOf(hits);
        }
        return String.format("%s阅读", hitsString);
    }

    public String getPlayTimesTotal() {
        String playTimesTotal;
        if (play_times_total >= 10000) {
            java.text.DecimalFormat df = new java.text.DecimalFormat("#.0");
            playTimesTotal = df.format(play_times_total / 10000d) + "万";
        } else {
            playTimesTotal = String.valueOf(play_times_total);
        }
        return String.format("%s播放", playTimesTotal);
    }

    public String getAnswer() {
        String answer;
        if (wd_answer >= 10000) {
            java.text.DecimalFormat df = new java.text.DecimalFormat("#.0");
            answer = df.format(wd_answer / 10000d) + "万";
        } else {
            answer = String.valueOf(wd_answer);
        }
        return String.format("%s回答", answer);
    }

}
